﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<title>订单详情-PHPMall</title>
	<meta name="Copyright" content="{$confRes.miaoshu}"/>
	<meta name="Keywords" content="{$confRes.sitename}"/>
	<meta name="Description" content="{$confRes.miaoshu}"/>
	<link rel="stylesheet" type="text/css" href="/static/index/css/pc-jifen-cart.89694c91.css"/>
	<link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css">
	<script src="/static/layer/jquery.min.js"></script>
	<script src="/static/layer/layer.js"></script>
</head>
<body>

<div id="header" class="header">
	<!--个人状态-->
	{include file="index@public/topmenu"}
	<!--个人状态end-->
	<!--导航栏-->
	{include file="index@public/topnav"}
	<!--导航栏end-->

</div>

<div class="content">
	<div class="order step1">
		<div class="order-header">
			<h2 class="title">订单详情</h2>
		</div>
		<?php $goods = json_decode($order['goods_item']) ;?>
		<?php $address = json_decode($order['address']) ;?>
		<div class="order-body">
			<div id="addressHolder" class="order-section address">
				<div class="order-section-header">
					<p class="order-sub-title">  &nbsp;
						订单号： {$order.order_id}<i></i>
						订单状态：
						{switch $order.status }
						{case 1 }
						<span class="green">待付款</span>
						{/case}
						{case 2 }
						已付款
						{/case}
						{case 3}
						<span class="green">未发货</span>
						{/case}
						{case 4}
						<a class="blue">已发货</a>
						{/case}
						{case 5}
						<a class="blue">交易成功</a>
						{/case}
						{case 6}
						<a class="blue">交易关闭</a>
						{/case}
						{default /}订单异常
						{/switch}
					</p>
				</div>
			</div>
			<div class="order-section order-detail">
				<div id="" class="order-section address">
					<div class="order-section-header">
						<p class="order-sub-title">  &nbsp;
							订单信息
						</p>
					</div>
					<div class="order-section-body">

						<ul  class="address-list address-manage-list" data-type="rich-radio" style="">
							<li class="address-item">
								&nbsp;&nbsp;<b>收货人信息：</b>
			            		<?php echo $address->city ;?>，<?php echo $address->country ;?>，<?php echo $address->detail ;?>, <?php echo $address->detailed ;?>，
									<?php echo $address->name ;?>，
									<?php echo $address->province ;?>
								</li>
						</ul>
						<ul id="addressList" class="address-list address-manage-list" data-type="rich-radio" style="">
							<li class="address-item">
								&nbsp;&nbsp;<b>付款方式：  </b>
								<span id="js_payshow">
								微信
								</span>
							</li>
						</ul>
					</div>
					<div class="order-section order-detail">
						<table class="order-detail-table">
							<thead>
							<tr>
								<th class="supplier">信息</th>
								<th class="supplier">名称</th>
								<th class="unit-price">单价（元）</th>
								<th class="amount">数量</th>
								<th class="total">小计（元）</th>
							</tr>
							</thead>
							<tbody>
							<?php foreach($goods as $v_doods): ?>
							<?php $goodss = $v_doods->goods;?>
							<tr data-type="item">
								<td>
									<?php $id = $goodss->id;?>
									<div class="product cf">
										<a class="product-img" href="{:url('index/Goods/index',array('id'=>$id))}" >
											<img width="50" src="/static/uploads/<?php echo $goodss->og_thumb?>" alt="<?php echo $goodss->goods_name?>">
										</a>
									</div>
								</td>
								<td>
									<div class="product-intro">
										<a class="product-name" href="{:url('index/Goods/index',array('id'=>$id))}" target="_blank"><?php echo $goodss->goods_name?></a>
									</div>
								</td>
								<td style="padding-left: 40px;">￥<span class="js_realPrice_0 num"><?php echo $goodss->shop_price?></span></td>
								<td style="padding-left: 110px;"><span class="num"><?php echo $v_doods->number?></span></td>

								<td style="padding-left: 60px;">￥<span class="js_totalFee_0 num"><?php echo $v_doods->number *  $goodss->shop_price ?></span>
								</td>
							</tr>
							<?php endforeach;?>
							</tbody>
						</table>

						<div class="order-total-cost-wrap cf">
							<div class="order-total-cost">
								<div class="cost-item">
									<span class="key" title="">实付款（含运费）</span>
									<span class="value total">￥<span id="orderTotalFee" class="num">{$order.payment}</span></span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!--尾部-->
{include file="index@public/footer"}
<!--尾部end-->

<script type="text/javascript" src="/static/index/js/c22559310a7b450cbe60c70169dd1d6f.js" charset="UTF-8"></script>
<script type="text/javascript" src="/static/index/js/midaslogdata.3586e7e2.js"></script>
<script type="text/javascript" src="/static/index/js/cart.15ad37ae.js"></script>


<script>
    function x_admin_show(title,url,w,h){
        if (title == null || title == '') {
            title=false;
        };
        if (url == null || url == '') {
            url="404.html";
        };
        if (w == null || w == '') {
            w=($(window).width()*0.9);
        };
        if (h == null || h == '') {
            h=($(window).height() - 50);
        };
        layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose: true,
            shade:0.4,
            title: title,
            content: url
        });
    }
    function order() {
        var address_is = $("#address_is").val();
        if(address_is == 0){
            layer.alert('请添加收获地址后再尝试下单',function () {
                layer.msg('加载中');
                x_admin_show('物流信息','{:url(\'user/user/addAddress\')}',600,600);
            });
            return;
        }
        // 获取手机地址
        var addressID = $("input[name='address']:checked").val();
        $.ajax({
            url:"{:url('user/order/order')}",
            type:"POST",
            dataType:"json",
            data:{
                addressID:addressID
            },
            success:function (res) {
                if(res.code == -1){
                    layer.alert(res.msg,function () {
                        layer.msg('加载中');
                        x_admin_show('物流信息','{:url(\'user/user/addAddress\')}',600,600);
                    })
                }else if(res.code == 1){
                    layer.alert('下单成功！请支付',function () {
                        var url = "/show_order/"+res.orderId+".html";
                        location.href = url;
                    })
                }else if(res.code == -2){
                    layer.alert(res.msg,function () {
                        location.href = "/";
                    })
                }else if(res.code == -5){
                    layer.alert(res.msg)
                    return ;
                }
            }
        });

    }

</script>

</body>
</html>
